package api

import (
	"1-12zk/api/handlers"
	"1-12zk/api/middleware"
	"github.com/gin-gonic/gin"
	jwt "github.com/golangblogs/gojwt"
)

func LoadRouter(r *gin.Engine) {
	r.Use(middleware.WoeM())
	user := r.Group("/user")
	{
		user.POST("/login", handlers.Login)
		user.Use(jwt.JWTAuth("2209a"))
		user.POST("/addarticle", handlers.AddArticle)
		user.GET("/chat", handlers.Chat)
		user.POST("/list", handlers.List)
		user.POST("/addfollow", handlers.AddFollOw)
		user.POST("/addroom", handlers.AddRoom)
		user.POST("/addroomuser", handlers.AddRoomUser)
		user.POST("/del", handlers.Del)
		user.POST("/update", handlers.Update)
	}

}
